<template>
<div class="tabbar_cont" @click.stop>
  <div class="flex_r tabbar">
    <div class="flex1 flex_center" @click="onLink('/')">
      <img v-if="path === '/'" src="../assets/img/music/tabbar_music_active.png" alt="">
      <img v-else src="../assets/img/music/tabbar_music_normal.png" alt="">
    </div>
    <div class="flex1 flex_center" @click="onLink('/music/center')">
      <img v-if="path === '/music/center'" src="../assets/img/music/tabbar_center_active.png" alt="">
      <img v-else src="../assets/img/music/tabbar_center_normal.png" alt="">
    </div>
  </div>
</div>
</template>
<script setup>
import { ref, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useMusicStore } from '@/store/index';
import { storeToRefs } from "pinia";
const store = useMusicStore();
const { musicIndex, musicList, isPlay, changePlayStatus } = storeToRefs(store)
let route = useRoute()
let router = useRouter()
let path = computed(() => {
  return route.path
})
let onLink = url => {
  store.setMusicIndex(-1)
  store.setPlayStatus(false)
  router.replace(url)
}
</script>
<style lang="scss" scoped>
.tabbar_cont {
  background: #161616;
  height: calc(54px + constant(safe-area-inset-bottom));
  height: calc(54px + env(safe-area-inset-bottom));
}
.tabbar {
  box-sizing: content-box;
  padding-bottom: calc(constant(safe-area-inset-bottom));;
  padding-bottom: calc(env(safe-area-inset-bottom));;
  background: #161616;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  img {
    width: 24px;
    height: 24px;
  }
}
</style>